package com.kd.controller;



import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kd.bean.Users;
import com.kd.service.IUserService;

@Controller
public class UserController {
	@Autowired
	private IUserService service;
	
	@RequestMapping("UserLogin_url")
	public String UserLogin_method(String username,String password,
				HttpServletRequest request) {
		try {
			Users us_login = service.login(username, password);
			if(us_login!=null) {
				request.setAttribute("us_login", us_login);
				return "user_Max.jsp";
			}
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "user_Login.jsp";
	}
}
